package cn.bone.springcloud.controller;

import cn.bone.springcloud.service.IPaymentService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
public class OrderController {

    @Resource
    private IPaymentService paymentService;

    @RequestMapping("/order/success/{id}")
    public String paymentInfoSuccess(@PathVariable("id") Integer id){
        String result = paymentService.paymentInfoSuccess(id);
        log.info("paymentInfoSuccess result:{}",result);
        return result;
    }


    @RequestMapping("/order/timeout/{id}")
    public String paymentInfoTimeout(@PathVariable("id") Integer id){
        String result = paymentService.paymentInfoTimeout(id);
        log.info("paymentInfoTimeout result:{}",result);
        return result;
    }
}
